package com.notes.model;


import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.hibernate.annotations.GenericGenerator;

@Entity
public class User {
	
	private Long userId;
	private String userName;
	private String password;
	private Set<Item> itemSet = new HashSet<Item>();
	
	@Id
	@GenericGenerator(name="gen",strategy="increment")
	@GeneratedValue(generator="gen")
	@Column(name = "userId", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getUserId() {
		return userId;
	}
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@OneToMany(mappedBy="user", cascade=CascadeType.ALL)
	public Set<Item> getItemSet() {
		return itemSet;
	}
	public void setItemSet(Set<Item> itemSet) {
		this.itemSet = itemSet;
	}
	
	
}
